package ai.leinao.common.actor;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicBoolean;

/**
 * actor 邮箱
 *
 * @author zhong.wang
 * @date 2025/8/27
 **/
@Slf4j
@Getter
@RequiredArgsConstructor
public class ActorMailbox implements ActorRef{
    /**
     * 高优先级
     */
    private static final boolean HIGH_PRIORITY = true;

    /**
     * 正常优先级
     */
    private static final boolean NORMAL_PRIORITY = false;

    /**
     * 空闲
     */
    private static final boolean FREE = false;
    /**
     * 就绪
     */
    private static final boolean BUSY = true;

    private static final boolean NOT_READY = false;
    private static final boolean READY = true;

    private final String actorId;

    private final Actor actor;

    private final ActorRef parent;

    private final ConcurrentLinkedQueue<ActorMsg> highPriorityMsgs = new ConcurrentLinkedQueue<>();
    private final ConcurrentLinkedQueue<ActorMsg> normalPriorityMsgs = new ConcurrentLinkedQueue<>();

    private final AtomicBoolean busy = new AtomicBoolean(FREE);
    private final AtomicBoolean ready = new AtomicBoolean(NOT_READY);

    private final Dispatcher dispatcher;



    @Override
    public String getActorId() {
        return null;
    }

    @Override
    public ActorRef getParentRef() {
        return null;
    }

    @Override
    public void tell(String actorId, ActorMsg msg) {

    }

    @Override
    public void tell(ActorMsg msg) {

    }

    @Override
    public void tellHighPriority(ActorMsg msg) {

    }
}
